"""
需求相关数据模式
"""

from pydantic import BaseModel
from typing import Optional, List
from datetime import datetime


class RequirementBase(BaseModel):
    """需求基础模式"""
    title: str
    description: Optional[str] = None
    content: Optional[str] = None
    tags: Optional[List[str]] = None


class RequirementCreate(RequirementBase):
    """需求创建模式"""
    pass


class RequirementUpdate(BaseModel):
    """需求更新模式"""
    title: Optional[str] = None
    description: Optional[str] = None
    content: Optional[str] = None
    tags: Optional[List[str]] = None


class RequirementResponse(RequirementBase):
    """需求响应模式"""
    id: int
    created_by: int
    created_at: datetime
    updated_at: Optional[datetime] = None
    
    class Config:
        from_attributes = True 